package repository

import (
	"tong/global"
	"tong/model"
)

func LoginUser(name string, password string) (user model.User, err error) {
	err = global.DB.Where("name = ?", name).Where("password = ?", password).Find(&user).Error
	if err != nil {
		return model.User{}, err
	}
	return user, nil
}
